package com.sansecy.javafx.shape;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.shape.Line;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;

public class DrawingLine extends Application {
   @Override     
   public void start(Stage primaryStage) throws Exception {

      Line line = new Line(100, 100, 500, 100);


      Text text = new Text();
      text.setFont(new Font(30));
      text.setX(50);
      text.setY(150);
      text.setText("Welcome to Tutorialspoint");

      Group group = new Group(text);
      group.getChildren().add(line);
      Scene scene = new Scene(group, 600, 300);
      Stage stage = new Stage();
      stage.setScene(scene);
      stage.setTitle("标题");
      stage.show();
   }
} 